package cn.hackcloud.designpattern.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class InfomationCollege implements College {
	List<Department> departments;

	public InfomationCollege() {
		super();
		this.departments = new ArrayList<Department>();
		addDepartment("信息安全", "信息安全");
		addDepartment("服务器安全", "服务器安全");
		addDepartment("网络安全", "网络安全");
	}

	@Override
	public String getName() {
		return "信息工程学院";
	}

	@Override
	public void addDepartment(String name, String desc) {
		Department department = new Department(name, desc);
		departments.add(department);
	}

	@Override
	public Iterator createIterator() {
		return new InfomationIterator(departments);
	}

}
